using System;
using System.Collections;

namespace LocalBoard.Domain
{
	/// <summary>
	/// Summary description for PollMessage.
	/// </summary>
	public class PollMessage : Message
	{
		public PollMessage(int id, int no, string subject, string body, string postedByUserName, string postedByUserId, int hits, DateTime date, Profile author, int boardId, int clubId, int replyToId, ArrayList replies, ArrayList comments, ArrayList attachments, ArrayList pollItems, ArrayList voterIdList) : base(id, no, subject, body, postedByUserName, postedByUserId, hits, date, author, boardId, clubId, replyToId, replies, comments, attachments)
		{
			_pollItems = pollItems;
			_voterIdList = voterIdList;
		}
		public PollMessage(string subject, string body, string postedByUserName, string postedByUserId, Profile author, int boardId, int clubId, int replyToId) : base(subject, body, postedByUserName, postedByUserId, author, boardId, clubId, replyToId)
		{
		}

		private ArrayList _pollItems;
		private ArrayList _voterIdList;

		public ArrayList PollItems
		{
			get{return _pollItems;}
//			set{_pollItems = value;}
		}

		public bool DidUserVote(int profileId)
		{
			if(_voterIdList.Contains(profileId))
				return true;
			else
				return false;
		}
	}
}
